#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include <QTreeView>
#include <QGridLayout>
#include <QTabWidget>
#include <QSplashScreen>

#include "ModelView.h"
#include "About.h"
#include "HelpBrowser.h"
#include "Splash.h"

namespace Ui
{
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
	enum MouseMode {SELECT, ROTATE, ZOOM, TRANSLATE};

public:
	MainWindow(Splash& splash, QWidget *parent = 0);
    ~MainWindow();

	static MainWindow* instance();

	MouseMode	getMouseMode() { return mouseMode; }

public slots:
    void    resetLayout();
    void    switchGridView();
    void    showAbout();
    void    showHelp();
    void    closeEvent(QCloseEvent *event);
    void    changeMouseMode(bool enable);

private slots:
    void    updateSelectedView();

private:
    Ui::MainWindow *ui;
    QGridLayout *treeLayout;
    QTreeView *treeView;
    QGridLayout *toolLayout;
    QTabWidget *toolTab;
    QByteArray layout;
    ModelView *modelViews[4];
    About *about;
    HelpBrowser *help;
    int selectedView;
	MouseMode mouseMode;

	static MainWindow* mainWindow;
};

#endif // MAINWINDOW_H
